-- msg_enter_room
-- Create by weism
-- 通知玩家进入了某个房间

return function(lpc)
    local rid = lpc.rid;
    local user = RID.find(rid);
    if (user == nil) then
        -- 玩家不存在，需要构造出来
        local dbase = lpc.data;
        dbase.rid = rid;
        user = User.new(dbase);
    else
        user.dbase:aborb(lpc.data);
    end
    
    if rid == ME.user.rid then
        local building = RID.find(user.dbase:query("room", ""));
        if (building == nil) then
            trace("msg_enter_room", "建筑物%s不存在，不应该啊", user.dbase:query("room", ""));
            return;
        end
        
        trace("msg_enter_room", "玩家进入建筑物：%s", building.base.name);
        ME.enterRoom(building);
    end
end
